home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / K-3D / k3d-0.4.2.1 / shaders / k3d_emboss.sl < prev    next >
Encoding:
Text File  |  2004-07-23  |  473 b   |  19 lines

  1. /* Copyrighted Pixar 1989 */
  2. /* From the RenderMan Companion p.383 */
  3. /* Listing 16.36  Displacement shader embossing a surface using a texture */
  4.  
  5. /*
  6.  * emboss(): emboss a pencil with lettering.  It uses the same texture
  7.  *     map as sdixon() to define the lettering.
  8.  */
  9. displacement
  10. k3d_emboss(    
  11.     float    Km        = .05;
  12.     string    texturename    = "")
  13. {
  14.     if( texturename != "") {
  15.         P -= Km * texture(texturename, s, t) * normalize(N);
  16.         N = calculatenormal(P);
  17.     }
  18. }
  19.